Attribute VB_Name = "settings"
Option Explicit
Public Sub settingsload()

  RFU1 = CBool(GetSetting("vbsms+", "input1", "rfu1", CBool(False)))
  RFU2 = CBool(GetSetting("vbsms+", "input1", "rfu2", CBool(False)))
  RFU12 = CBool(GetSetting("vbsms+", "input2", "rfu1", CBool(False)))
  RFU22 = CBool(GetSetting("vbsms+", "input2", "rfu2", CBool(False)))
  Zoom_Size = CInt(GetSetting("vbsms+", "video", "zoomsize", CInt(1)))
  FullScreenWidth = CLng(GetSetting("vbsms+", "video", "fullscreenwidth", CLng(320)))
  FullScreenHeight = CLng(GetSetting("vbsms+", "video", "fullscreenheight", CLng(240)))
  FullScreenOnROM = CBool(GetSetting("vbsms+", "video", "fullscreenonrom", CBool(False)))
  ScreenResolutionChange = CBool(GetSetting("vbsms+", "video", "screenresolutionchange", CBool(True)))
  Input1_Up = CInt(GetSetting("vbsms+", "input1", "up", CInt(vbKeyUp)))
  Input1_Down = CInt(GetSetting("vbsms+", "input1", "down", CInt(vbKeyDown)))
  Input1_Left = CInt(GetSetting("vbsms+", "input1", "left", CInt(vbKeyLeft)))
  Input1_Right = CInt(GetSetting("vbsms+", "input1", "right", CInt(vbKeyRight)))
  Input1_1 = CInt(GetSetting("vbsms+", "input1", "1", CInt(vbKeyZ)))
  Input1_2 = CInt(GetSetting("vbsms+", "input1", "2", CInt(vbKeyX)))
  Input1_GGStart = CInt(GetSetting("vbsms+", "input1", "ggstart", CInt(vbKeyC)))
  Input1_Pause = CInt(GetSetting("vbsms+", "input1", "pause", CInt(vbKeyReturn)))
  Input1_UseGamepad = CBool(GetSetting("vbsms+", "input1", "usegamepad", CBool(False)))
  Input1_WhichGamepad = CLng(GetSetting("vbsms+", "input1", "whichgamepad", CLng(JOYSTICK1)))
  Input2_Up = CInt(GetSetting("vbsms+", "input2", "up", 0))
  Input2_Down = CInt(GetSetting("vbsms+", "input2", "down", 0))
  Input2_Left = CInt(GetSetting("vbsms+", "input2", "left", 0))
  Input2_Right = CInt(GetSetting("vbsms+", "input2", "right", 0))
  Input2_1 = CInt(GetSetting("vbsms+", "input2", "1", 0))
  Input2_2 = CInt(GetSetting("vbsms+", "input2", "2", 0))
  Input2_UseGamepad = CBool(GetSetting("vbsms+", "input2", "usegamepad", CBool(False)))
  Input2_WhichGamepad = CLng(GetSetting("vbsms+", "input2", "whichgamepad", CLng(JOYSTICK2)))
  Joy1_1 = CLng(GetSetting("vbsms+", "input1", "j1", CLng(JOY_BUTTON1)))
  Joy1_2 = CLng(GetSetting("vbsms+", "input1", "j2", CLng(JOY_BUTTON2)))
  Joy1_GGStart = CLng(GetSetting("vbsms+", "input1", "jggstart", CLng(JOY_BUTTON3)))
  Joy1_Pause = CLng(GetSetting("vbsms+", "input1", "jpause", CLng(JOY_BUTTON4)))
  Joy2_1 = CLng(GetSetting("vbsms+", "input2", "j1", CLng(JOY_BUTTON1)))
  Joy2_2 = CLng(GetSetting("vbsms+", "input2", "j2", CLng(JOY_BUTTON2)))
  BG_Color = CInt(GetSetting("vbsms+", "video", "bgcolor", CInt(13)))
  DoGameGearBorder = CBool(GetSetting("vbsms+", "video", "gamegearborder", CBool(True)))
  LimitSprites = CBool(GetSetting("vbsms+", "video", "limitsprites", CBool(False)))
  Mutey = CBool(GetSetting("vbsms+", "audio", "mute", CBool(False)))
  CurrentSampleRate = CInt(GetSetting("vbsms+", "audio", "samplerate", CInt(2)))
  usa = CBool(GetSetting("vbsms+", "vm", "region", CBool(True)))
  Disable3D = CBool(GetSetting("vbsms+", "video", "disable3d", CBool(False)))
  ShowOnlyleft = CBool(GetSetting("vbsms+", "video", "showonlyleft", CBool(False)))
End Sub
Public Sub settingssave()

  Call SaveSetting("vbsms+", "video", "zoomsize", CInt(Zoom_Size))
  Call SaveSetting("vbsms+", "video", "fullscreenwidth", CLng(FullScreenWidth))
  Call SaveSetting("vbsms+", "video", "fullscreenheight", CLng(FullScreenHeight))
  Call SaveSetting("vbsms+", "video", "fullscreenonrom", CBool(FullScreenOnROM))
  Call SaveSetting("vbsms+", "video", "screenresolutionchange", CBool(ScreenResolutionChange))
  Call SaveSetting("vbsms+", "input1", "up", CInt(Input1_Up))
  Call SaveSetting("vbsms+", "input1", "down", CInt(Input1_Down))
  Call SaveSetting("vbsms+", "input1", "left", CInt(Input1_Left))
  Call SaveSetting("vbsms+", "input1", "right", CInt(Input1_Right))
  Call SaveSetting("vbsms+", "input1", "1", CInt(Input1_1))
  Call SaveSetting("vbsms+", "input1", "2", CInt(Input1_2))
  Call SaveSetting("vbsms+", "input1", "ggstart", CInt(Input1_GGStart))
  Call SaveSetting("vbsms+", "input1", "usegamepad", CBool(Input1_UseGamepad))
  Call SaveSetting("vbsms+", "input1", "whichgamepad", CLng(Input1_WhichGamepad))
  Call SaveSetting("vbsms+", "input1", "j1", CLng(Joy1_1))
  Call SaveSetting("vbsms+", "input1", "j2", CLng(Joy1_2))
  Call SaveSetting("vbsms+", "input1", "jggstart", CLng(Joy1_GGStart))
  Call SaveSetting("vbsms+", "input1", "jpause", CLng(Joy1_Pause))
  Call SaveSetting("vbsms+", "input1", "rfu1", CBool(RFU1))
  Call SaveSetting("vbsms+", "input1", "rfu2", CBool(RFU2))
  Call SaveSetting("vbsms+", "input2", "rfu1", CBool(RFU12))
  Call SaveSetting("vbsms+", "input2", "rfu2", CBool(RFU22))
  Call SaveSetting("vbsms+", "input2", "up", CInt(Input2_Up))
  Call SaveSetting("vbsms+", "input2", "down", CInt(Input2_Down))
  Call SaveSetting("vbsms+", "input2", "left", CInt(Input2_Left))
  Call SaveSetting("vbsms+", "input2", "right", CInt(Input2_Right))
  Call SaveSetting("vbsms+", "input2", "usegamepad", CBool(Input2_UseGamepad))
  Call SaveSetting("vbsms+", "input2", "whichgamepad", CLng(Input2_WhichGamepad))
  Call SaveSetting("vbsms+", "input2", "j1", CLng(Joy2_1))
  Call SaveSetting("vbsms+", "input2", "j2", CLng(Joy2_2))
  Call SaveSetting("vbsms+", "input2", "1", CInt(Input2_1))
  Call SaveSetting("vbsms+", "input2", "2", CInt(Input2_2))
  Call SaveSetting("vbsms+", "video", "bgcolor", CInt(BG_Color))
  Call SaveSetting("vbsms+", "video", "gamegearborder", CBool(DoGameGearBorder))
  Call SaveSetting("vbsms+", "video", "limitsprites", CBool(LimitSprites))
  Call SaveSetting("vbsms+", "audio", "mute", CBool(Mutey))
  Call SaveSetting("vbsms+", "audio", "samplerate", CInt(CurrentSampleRate))
  Call SaveSetting("vbsms+", "vm", "region", CBool(usa))
  Call SaveSetting("vbsms+", "video", "disable3d", CBool(Disable3D))
  Call SaveSetting("vbsms+", "video", "showonlyleft", CBool(ShowOnlyleft))
End Sub
